function editEntry(entryId) {
	// load entry info via ajax
	AjaxController.getEntry(entryId, handleEditEntry);

}

function handleEditEntry(entry) {
	document.entryForm.id.value = entry.id;
	document.entryForm.title.value = entry.title;
	document.entryForm.destination.value = entry.destination;
	document.entryForm.date.value = entry.formattedDate;
	document.entryForm.entryText.value = entry.entryText;
	showEntry();
}


function deleteEntry(entryId) {
	// load entry info via ajax
	if (confirm("Are you sure you want to delete this entry?")) {
		document.location.href = "deleteEntry.do?entryId=" + entryId;
	}

}


function newEntry() {
	document.entryForm.id.value = "";
	document.entryForm.title.value = "";
	document.entryForm.destination.value = "";
	document.entryForm.entryText.value = "";
	document.entryForm.date.value = getCurrentFormattedDate();
	showEntry();
}


function showEntry() {
	openPopup("entry_div");
	
}


